var abatchlist = null;
var aPBase = null;

$(function () {

        $.get(baseURL + "bss/abatch/select", function(r) {
            abatchlist =r.aBatchList;
            vm.abatchlist=abatchlist;
        });
        $.get(baseURL + "bss/apbase/selectone/"+GetUrlParam("guid"), function(r){
            aPBase = r.aPBase;
            console.log(r.aPBase);
            vm.aPBase =aPBase;
        });

});
var vm = new Vue({
    el:'#rrappm',

    data:{
        abatchlist:abatchlist,
        aPBase:aPBase
    },
    methods: {
        saveOrUpdate: function (event) {

            if(vm.aPBase.pBState!="30")
            {
                alert('项目状态没有归档，不能设置批次');
                return ;
            }
            var url = "bss/apbase/update";

            $.ajax({
                type: "POST",
                url: baseURL + url,
                contentType: "application/json",
                data: JSON.stringify(vm.aPBase),
                success: function(r){
                    if(r.code === 0){
                        alert('操作成功', function(index){

                         });
                    }else{
                        alert(r.msg);
                    }
                }
            });
        }
    }
});



